feat: Add GlassyFileUpload component with drag-and-drop zone - #773
Open
sonusharma6-dsa wants to merge 2 commits into
Open
feat: Add GlassyFileUpload component with drag-and-drop zone#773sonusharma6-dsa wants to merge 2 commits into
sonusharma6-dsa wants to merge 2 commits into
Conversation
|
@sonusharma6-dsa is attempting to deploy a commit to the jaishree2310's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds a new “File Upload” component demo/detail page to the GlassyUI components gallery, wiring it into navigation and routing, and introduces a global code-block copy-button behavior via PageShell.
Changes:
- Add
FileUploadDetailsPage(with an embeddedGlassyFileUploaddemo) and route it under/file-upload-details. - Add a “File Upload” card entry to the components gallery page.
- Inject a global “copy to clipboard” button into
<pre>blocks withinPageShell.
Reviewed changes
Copilot reviewed 4 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/PageShell.tsx | Adds DOM-based injection of copy-to-clipboard buttons for code blocks. |
| src/components/GlassyUIComponentsPage.tsx | Adds a “File Upload” card that navigates to the new details route. |
| src/components/GlassyFileUpload.tsx | Introduces the file upload demo UI and the new details page content. |
| src/App.tsx | Registers the new /file-upload-details route. |
| build/static/css/main.73cc8df5.css | Removes a built CSS artifact from the repository. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+36
to
+39
| // Exclude the button text itself if it was copied | ||
| const textToCopy = (preEl.innerText || '') | ||
| .replace(/Copy|Copied!/g, '') | ||
| .trim(); |
Comment on lines
+14
to
+19
| // Avoid duplicate buttons | ||
| if ( | ||
| pre.querySelector('.global-copy-btn') || | ||
| pre.parentElement?.querySelector('button') | ||
| ) | ||
| return; |
Comment on lines
+25
to
+28
| const btn = document.createElement('button'); | ||
| btn.className = | ||
| 'global-copy-btn absolute top-2 right-2 backdrop-filter backdrop-blur-xl bg-white/10 border border-white/20 p-2 hover:bg-white/30 rounded-md transition-all duration-300 z-10 text-white flex items-center justify-center'; | ||
| btn.title = 'Copy to clipboard'; |
Comment on lines
+185
to
+189
| <GlassyFileUpload | ||
| onUpload={(files) => console.log('Uploading files:', files)} | ||
| /> | ||
| ); | ||
| }`; |
Comment on lines
+88
to
+93
| <div | ||
| onDragEnter={handleDrag} | ||
| onDragOver={handleDrag} | ||
| onDragLeave={handleDrag} | ||
| onDrop={handleDrop} | ||
| onClick={onButtonClick} |
Comment on lines
+151
to
+157
| <button | ||
| onClick={e => { | ||
| e.stopPropagation(); | ||
| removeFile(idx); | ||
| }} | ||
| className='p-1 hover:bg-white/10 rounded-full text-white/50 hover:text-white' | ||
| > |
Comment on lines
+100
to
+104
| <input | ||
| ref={fileInputRef} | ||
| type='file' | ||
| multiple | ||
| onChange={handleChange} |
|
|
||
| {/* Uploading Status */} | ||
| {uploading && ( | ||
| <div className='w-full mt-4 flex items-center justify-center p-3 bg-white/5 rounded-lg border border-white/10'> |
|
|
||
| {/* Success Status */} | ||
| {uploaded && ( | ||
| <div className='w-full mt-4 flex items-center justify-center p-3 bg-green-500/20 rounded-lg border border-green-500/30 text-green-300'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #771. Introduces the new GlassyFileUpload component featuring drag-and-drop support, visual active drag states, multi-file selection, simulated file uploads, and standard glassmorphic aesthetics.